Optimal. Leaf size=44 \[ -\frac {x}{a}+\frac {2 \sin (c+d x)}{a d}-\frac {\sin (c+d x)}{d (a+a \sec (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {3904, 3872,
2717, 8} \begin {gather*} \frac {2 \sin (c+d x)}{a d}-\frac {\sin (c+d x)}{d (a \sec (c+d x)+a)}-\frac {x}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2717
Rule 3872
Rule 3904
Rubi steps
\begin {align*} \int \frac {\cos (c+d x)}{a+a \sec (c+d x)} \, dx &=-\frac {\sin (c+d x)}{d (a+a \sec (c+d x))}-\frac {\int \cos (c+d x) (-2 a+a \sec (c+d x)) \, dx}{a^2}\\ &=-\frac {\sin (c+d x)}{d (a+a \sec (c+d x))}-\frac {\int 1 \, dx}{a}+\frac {2 \int \cos (c+d x) \, dx}{a}\\ &=-\frac {x}{a}+\frac {2 \sin (c+d x)}{a d}-\frac {\sin (c+d x)}{d (a+a \sec (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(89\) vs. \(2(44)=88\).
time = 0.24, size = 89, normalized size = 2.02 \begin {gather*} \frac {\sec \left (\frac {c}{2}\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (-2 d x \cos \left (\frac {d x}{2}\right )-2 d x \cos \left (c+\frac {d x}{2}\right )+5 \sin \left (\frac {d x}{2}\right )+\sin \left (c+\frac {d x}{2}\right )+\sin \left (c+\frac {3 d x}{2}\right )+\sin \left (2 c+\frac {3 d x}{2}\right )\right )}{4 a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 56, normalized size = 1.27
method | result | size |
derivativedivides | \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}-2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(56\) |
default | \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}-2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(56\) |
risch | \(-\frac {x}{a}-\frac {i {\mathrm e}^{i \left (d x +c \right )}}{2 a d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )}}{2 a d}+\frac {2 i}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}\) | \(66\) |
norman | \(\frac {\frac {\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {x}{a}+\frac {3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\) | \(76\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 92 vs.
\(2 (44) = 88\).
time = 0.49, size = 92, normalized size = 2.09 \begin {gather*} -\frac {\frac {2 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {2 \, \sin \left (d x + c\right )}{{\left (a + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.88, size = 46, normalized size = 1.05 \begin {gather*} -\frac {d x \cos \left (d x + c\right ) + d x - {\left (\cos \left (d x + c\right ) + 2\right )} \sin \left (d x + c\right )}{a d \cos \left (d x + c\right ) + a d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\cos {\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.46, size = 58, normalized size = 1.32 \begin {gather*} -\frac {\frac {d x + c}{a} - \frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a} - \frac {2 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )} a}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.66, size = 66, normalized size = 1.50 \begin {gather*} \frac {2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\left (-c-d\,x\right )\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,d\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________